#include "LogLevel.h"

#include <string.h>
#include <fan-llvm/core/Core.h>
#include "Type.h"
#include "UnsupportedErr.h"


Type* LogLevel_classType = NULL;
VTable* LogLevel_classVTable = NULL;


/**********************************************
 *
 * Methods and fields
 *
 **********************************************/


/* LogLevel debug */
LogLevel* LogLevel_debug(void)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::LogLevel.debug not implemented yet"));
}


/* LogLevel info */
LogLevel* LogLevel_info(void)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::LogLevel.info not implemented yet"));
}


/* LogLevel warn */
LogLevel* LogLevel_warn(void)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::LogLevel.warn not implemented yet"));
}


/* LogLevel err */
LogLevel* LogLevel_err(void)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::LogLevel.err not implemented yet"));
}


/* LogLevel silent */
LogLevel* LogLevel_silent(void)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::LogLevel.silent not implemented yet"));
}


/* LogLevel[] vals */
List* LogLevel_vals(void)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::LogLevel.vals not implemented yet"));
}


/* LogLevel? fromStr(Str name, Bool checked) */
LogLevel* LogLevel_fromStr_1(Str* name)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::LogLevel.fromStr not implemented yet"));
}


/* LogLevel? fromStr(Str name, Bool checked) */
LogLevel* LogLevel_fromStr(Str* name, Bool checked)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::LogLevel.fromStr not implemented yet"));
}


/**********************************************
 *
 * Type-system functions
 *
 **********************************************/


Type* LogLevel_initType(void)
{
  if (LogLevel_classType == NULL)
  {
    Type* baseType = Enum_initType();
    VTable* vtable = LogLevel_initVTable();
    Type* type = Type_new("LogLevel", baseType, vtable, sizeof(LogLevel), sizeof(LogLevelVTable));
    Type_registerMethodImplementation(type, "fromStr", LogLevel_fromStr_1, 1);
    Type_registerMethodImplementation(type, "fromStr", LogLevel_fromStr, 2);
    Type_registerFieldImplementation(type, "debug", LogLevel_debug, NULL);
    Type_registerFieldImplementation(type, "err", LogLevel_err, NULL);
    Type_registerFieldImplementation(type, "info", LogLevel_info, NULL);
    Type_registerFieldImplementation(type, "silent", LogLevel_silent, NULL);
    Type_registerFieldImplementation(type, "vals", LogLevel_vals, NULL);
    Type_registerFieldImplementation(type, "warn", LogLevel_warn, NULL);
    LogLevel_classType = type;
    LogLevel_initStatic();
  }
  return LogLevel_classType;
}


VTable* LogLevel_initVTable(void)
{
  if (LogLevel_classVTable == NULL)
  {
    VTable* vtable = memoryAlloc(sizeof(LogLevelVTable));
    memcpy(vtable, Enum_initVTable(), sizeof(EnumVTable));
    LogLevel_classVTable = vtable;
  }
  return LogLevel_classVTable;
}


void LogLevel_initStatic(void)
{
}
